package cate.game.role.farm.udgpalace.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBUdgPalace;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "地宫探险处理事件的请求")
@OperationSetter(GDOperation.UDG_PALACE_EVENT_REWARD)
public class UdgPalaceHandleEventReq implements MsgInput {
    @NoteField("位置")
    public int pos;
    @NoteField("玩家的选择, 没有选择的事件就传0或不传, 猜拳：1剪刀 2石头 3布,  问答：1，2，3")
    public int choose;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getFarm().udgPalace.handlePosEvent(pos, choose);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBUdgPalace.HANDLE_EVENT_REQ;
    }
}
